const paramsObj = {
  setParams: (params, likeList) => {
    let str = ''
    const keys = Object.keys(params)
    const values = Object.values(params)
    if(values.length > 0){
      str = ' where'
      keys.forEach((item, index) => {
        if(likeList.length > 0&& likeList.includes(item)){
          str += ` ${item} like "%${values[index]}%" and`
        }else{
          str += ` ${item}=${values[index]} and`
        }
      })
      str = str.substring(0,str.length - 3)
    }
    return str
  }
}

module.exports = paramsObj
